//2009/08/10 02:05:40
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class Stairs
{
public:
    int designs(int maxHeight, int minWidth, int totalHeight, int totalWidth)
    {
		int ret = 0;
        for(int i = 1; i<=maxHeight; i++){
                if(totalHeight % i!=0)continue;
				//Next, we calculate the width of the treads. 
				//The number of risers is totalHeight/height, 
				//and there is one less tread than riser.
                int cnt = totalHeight/i-1;
                if(cnt==0 || totalWidth%cnt!=0 || totalWidth/cnt < minWidth)continue;
                ret++;
        }
        return ret;

    }
};
